<%--
    Document   : error
    Created on : Jun 6, 2014, 4:34:44 AM
    Author     : Satyapal
--%>
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%

        String copyfirstName=(String)session.getAttribute("copyfirstName");
        String copylastName=(String)session.getAttribute("copylastName");
        String id=(String)session.getAttribute("id");
        String activationCode=(String)session.getAttribute("activationCode");
        String message="";

        if(copyfirstName==null){
                message="User ";
                session.setAttribute("message","1");
                String  url[]=request.getRequestURI().split("/");
                String pageRedir=url[2];
                session.setAttribute("pageRedir",pageRedir);
                response.sendRedirect("login.jsp");
                

            }
        else{
                message=copyfirstName.substring(0,1).toUpperCase()+copyfirstName.substring(1);
                out.print("<title>"+copyfirstName.substring(0,1).toUpperCase()+copyfirstName.substring(1)+"-Post Adverisement</title>");
            }

%>

<jsp:include page="header.jsp"/>
<jsp:include page="startUpWith.jsp"/>



<div style="position:relative;width: auto;z-index: 10000;">
    <div id="cssmenu" style="background-color: black;">
     <section class="innerpages">
         <div class="grid_12" style="background-image: url('commonfiles/images/satyapal.jpg'); width:100%;">
             <h1><%
             out.print(message+" Start Posting Your Advertisement Hear..");
            %> </h1>
         </div>
     </section>
</div>
</div>
<div class="block2">
  <div class="container_12">
    <!--==============================content================================-->
    <section class="content">
      <div class="wrapper">
        <article class="grid_12 last-col"><br><br><br>
          <div class="hello_box">
         
              <a href="MyPostedAd.jsp"><img src="" height="50"/>
              </a><hr>

              <html:form action="/PostAd">
                  <input type="text" hidden="" value="<%out.print(activationCode);%>" name="activationCode"/>
             <input  type="text" name="idFromUserInformation" hidden="" value="<%out.print(id);%>"/><br>
      Company Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <input type="text" name="postAd_Company_Name"/><br>
      Company Address:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <input type="text" name="postAd_Address"/><br>
      Location:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <input type="text" name="postAd_Location"/><br>
      Mobile Number:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="postAd_Mobile_Number"/><br>
      LandLine Number:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <input type="text" name="postAd_Landline_Number"/><br>
      Adv Size:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="postAd_Image_Size"/><br>

    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <div id="fileselect[]">
        <input type="file"   multiple />
</div>

<script>


    function run(){

        outputdiv = document.getElementById('pic');
	outputdiv.innerHTML ="Please Wait We Are Loading Your Image....";
    }

  function handleFileSelect(evt) {

    var files = evt.target.files; // FileList object

	//	hello();

        run();
    for (var i = 0, f; f = files[i]; i++) {



      var reader = new FileReader();

      reader.onload = (function(theFile) {
        return function(e) {

	im = new Image();

	im.src = e.target.result;
	var s=im.src;
	//alert(s);
	var text="<textarea name=\"postAd_Templet_Image\" hidden=\"\">"+s+"</textarea>";
	outputdiv = document.getElementById('text');
	outputdiv.innerHTML =text;

        outputdiv = document.getElementById('pic');
	outputdiv.innerHTML ="<img src='"+s+"' width=400 height=400/>";

	    };
      })(f);
      reader.readAsDataURL(f);
    }
  }

  document.getElementById('fileselect[]').addEventListener('change', handleFileSelect, false);
</script>

<div id="text"></div>
<div id="pic"></div>

<html:submit/>


        </html:form>





          </div>
        </article>
      </div>
      <div class="wrapper projects">
        <div class="row clearfix">
           
          
        </div>
      </div>
    </section>
  </div>
</div>


<jsp:include page="footer.jsp"/>
